package ru.integrationmessagers.vk.services.impl;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import ru.integrationmessagers.vk.client.VkClient;
import ru.integrationmessagers.vk.model.domain.Friend;
import ru.integrationmessagers.vk.model.dto.mapper.vk.VkFriendMapper;
import ru.integrationmessagers.vk.model.dto.vk.VkFriendDto;
import ru.integrationmessagers.vk.services.FriendService;

import java.util.List;

@Service
@RequiredArgsConstructor
public class FriendServiceImpl implements FriendService {

    private final VkClient vkClient;
    private final VkFriendMapper vkFriendMapper;

    @Override
    public List<Friend> getFriends() {
        List<VkFriendDto> vkFriendsDto = vkClient.getFriends();
        return vkFriendMapper.fromListDto(vkFriendsDto);
    }

}
